package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

@Data
@ApiModel(value = "销售订单")
@TableName("t_sale_order")
public class SaleOrderBean {
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_saleOrderId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "销售时间")
    @TableField("s_date")
    private LocalDate date=LocalDate.now();
    @ApiModelProperty(value = "订单总额")
    @TableField("s_totalPrice")
    private Integer totalPrice;
    @ApiModelProperty(value = "销售员真实名字")
    @TableField("s_saleName")
    private String saleName;
    @ApiModelProperty(value = "送货地址")
    @TableField("s_address")
    private String address;
    @ApiModelProperty(value = "客户名字")
    @TableField("s_customName")
    private String customName;

    @TableField(exist = false)
    private List<SaleDetailBean> saleList; /**销售明细 集合 */

    public SaleOrderBean() {
    }

    public SaleOrderBean( Integer totalPrice, String saleName, String address, String customName) {
        this.totalPrice = totalPrice;
        this.saleName = saleName;
        this.address = address;
        this.customName = customName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getSaleName() {
        return saleName;
    }

    public void setSaleName(String saleName) {
        this.saleName = saleName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public List<SaleDetailBean> getSaleList() {
        return saleList;
    }

    public void setSaleList(List<SaleDetailBean> saleList) {
        this.saleList = saleList;
    }

    @Override
    public String toString() {
        return "SaleOrderBean{" +
                "id=" + id +
                ", date=" + date +
                ", totalPrice=" + totalPrice +
                ", saleName='" + saleName + '\'' +
                ", address='" + address + '\'' +
                ", customName='" + customName + '\'' +
                ", saleList=" + saleList +
                '}';
    }
}
